import java.util.Random;
import java.util.Scanner;
public class GuessNumGame {
    public static void main(String[] args) {
        Scanner scan = new Scanner (System.in);//引入工具实现录入，scan为工具的代名
        Random GuessNum = new Random();//引入工具实现随机数生成，代名为GuessNum
        int RandomNum = GuessNum.nextInt(100);//格式：代名.next类型名
        while (true) {
            System.out.println("输入一个0到100直接的数字");
            int num = scan.nextInt();//格式：代名.next类型名.
            if(num>RandomNum) {
                System.out.println("猜大了");
            } else if(num==RandomNum) {
                System.out.println("猜对了");
                break;
            } else {
                System.out.println("猜小了");
            }
        }
    }
}
